Optimal. Leaf size=117 \[ \frac {b (4 A+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (3 A+2 C) \tan (c+d x)}{3 d}+\frac {b (4 A+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 117, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.226, Rules used = {4162, 4132,
3853, 3855, 4131, 3852, 8} \begin {gather*} \frac {a (3 A+2 C) \tan (c+d x)}{3 d}+\frac {a C \tan (c+d x) \sec ^2(c+d x)}{3 d}+\frac {b (4 A+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b (4 A+3 C) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {b C \tan (c+d x) \sec ^3(c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3853
Rule 3855
Rule 4131
Rule 4132
Rule 4162
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+b \sec (c+d x)) \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+b (4 A+3 C) \sec (c+d x)+4 a C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{4} \int \sec ^2(c+d x) \left (4 a A+4 a C \sec ^2(c+d x)\right ) \, dx+\frac {1}{4} (b (4 A+3 C)) \int \sec ^3(c+d x) \, dx\\ &=\frac {b (4 A+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{3} (a (3 A+2 C)) \int \sec ^2(c+d x) \, dx+\frac {1}{8} (b (4 A+3 C)) \int \sec (c+d x) \, dx\\ &=\frac {b (4 A+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b (4 A+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {(a (3 A+2 C)) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {b (4 A+3 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a (3 A+2 C) \tan (c+d x)}{3 d}+\frac {b (4 A+3 C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {b C \sec ^3(c+d x) \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.54, size = 80, normalized size = 0.68 \begin {gather*} \frac {3 b (4 A+3 C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (3 b (4 A+3 C) \sec (c+d x)+6 b C \sec ^3(c+d x)+8 a \left (3 (A+C)+C \tan ^2(c+d x)\right )\right )}{24 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 118, normalized size = 1.01
method | result | size |
derivativedivides | \(\frac {A b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+C b \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a A \tan \left (d x +c \right )-a C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(118\) |
default | \(\frac {A b \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+C b \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a A \tan \left (d x +c \right )-a C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(118\) |
norman | \(\frac {-\frac {\left (8 a A -4 A b +8 a C -5 C b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (8 a A +4 A b +8 a C +5 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (72 a A -12 A b +40 a C +9 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {\left (72 a A +12 A b +40 a C -9 C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {b \left (4 A +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {b \left (4 A +3 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(199\) |
risch | \(-\frac {i \left (12 A b \,{\mathrm e}^{7 i \left (d x +c \right )}+9 C b \,{\mathrm e}^{7 i \left (d x +c \right )}-24 A a \,{\mathrm e}^{6 i \left (d x +c \right )}+12 A b \,{\mathrm e}^{5 i \left (d x +c \right )}+33 C b \,{\mathrm e}^{5 i \left (d x +c \right )}-72 A a \,{\mathrm e}^{4 i \left (d x +c \right )}-48 C a \,{\mathrm e}^{4 i \left (d x +c \right )}-12 A b \,{\mathrm e}^{3 i \left (d x +c \right )}-33 C b \,{\mathrm e}^{3 i \left (d x +c \right )}-72 a A \,{\mathrm e}^{2 i \left (d x +c \right )}-64 C a \,{\mathrm e}^{2 i \left (d x +c \right )}-12 A b \,{\mathrm e}^{i \left (d x +c \right )}-9 C b \,{\mathrm e}^{i \left (d x +c \right )}-24 a A -16 a C \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{8 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{8 d}\) | \(279\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 152, normalized size = 1.30 \begin {gather*} \frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a - 3 \, C b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a \tan \left (d x + c\right )}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.88, size = 129, normalized size = 1.10 \begin {gather*} \frac {3 \, {\left (4 \, A + 3 \, C\right )} b \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, A + 3 \, C\right )} b \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (3 \, A + 2 \, C\right )} a \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, A + 3 \, C\right )} b \cos \left (d x + c\right )^{2} + 8 \, C a \cos \left (d x + c\right ) + 6 \, C b\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 304 vs.
\(2 (107) = 214\).
time = 0.47, size = 304, normalized size = 2.60 \begin {gather*} \frac {3 \, {\left (4 \, A b + 3 \, C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, A b + 3 \, C b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 72 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 72 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.64, size = 197, normalized size = 1.68 \begin {gather*} \frac {\left (A\,b-2\,A\,a-2\,C\,a+\frac {5\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (6\,A\,a-A\,b+\frac {10\,C\,a}{3}+\frac {3\,C\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {3\,C\,b}{4}-A\,b-\frac {10\,C\,a}{3}-6\,A\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,A\,a+A\,b+2\,C\,a+\frac {5\,C\,b}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {b\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,A+3\,C\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________